//
//  TMLoadImageView.m
//  TMtravel
//
//  Created by 谢黎明 on 2017/8/16.
//  Copyright © 2017年 tmkj. All rights reserved.
//

#import "TMLoadImageView.h"
@interface TMLoadImageView ()
{
    NSMutableArray *imageArray;
}

@end
@implementation TMLoadImageView

+ (instancetype)TMLoadImageView {
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] firstObject];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    [self loadImage];
}

- (void)loadImage {
//    imageArray = @[@"load_Image1",@"load_Image2",@"load_Image3",@"load_Image4",@"load_Image5",@"load_Image6",@"load_Image7",@"load_Image8",@"load_Image9",@"load_Image10",@"load_Image11",@"load_Image12",@"load_Image13",@"load_Image14",@"load_Image15",@"load_Image16",@"load_Image17",@"load_Image18",@"load_Image19",@"load_Image20",@"load_Image21",@"load_Image22",@"load_Image23",@"load_Image24",@"load_Image25",@"load_Image26",@"load_Image27",@"load_Image28",@"load_Image29",@"load_Image30",@"load_Image31",@"load_Image32",@"load_Image33",@"load_Image34",@"load_Image35",@"load_Image36",@"load_Image37",@"load_Image38"];
    
    imageArray = [[NSMutableArray alloc] init];
    
    for (NSInteger i = 0; i < 38; i++) {
        [imageArray addObject:[NSString stringWithFormat:@"load_Image%zd",i]];
    }
    
    self.loadImageView.contentMode = UIViewContentModeScaleToFill;
    NSMutableArray *imageAy = [NSMutableArray array];
    for (int i = 0; i<imageArray.count; i++) {
        UIImage *image = [UIImage imageNamed:imageArray[i]];
        [imageAy addObject:image];
    }
    self.loadImageView.animationImages = imageAy;
    self.loadImageView.animationRepeatCount = 0;
    self.loadImageView.animationDuration = 3;
    [self.loadImageView startAnimating];
}



@end
